package kr.hkit.powerjava.chapter20;

public class StringBuilderEx {
	public static void main(String[] args) {
		StringBuilder sb = new StringBuilder();
		sb.append("Hello");
		System.out.println(sb.toString());
		
		sb.append("java ");
		
		System.out.println(sb.toString());
		
		char ch =sb.charAt(1);
		System.out.println(ch);
		
//		sb.delete(5, 8);
//		System.out.println(sb);
		
		System.out.println("j의 위치 "+sb.indexOf("j"));
		
		sb.insert(5, ' ' );
		System.out.println(sb.length());
		
		sb.replace(6, 10, "Android");
		System.out.println(sb);
		
		StringBuilder jumin = new StringBuilder("123456-1234567");
		jumin.replace(7, jumin.length(), "*******");
		System.out.println(jumin);
		
//		System.out.println(sb.reverse());
		
		System.out.println(sb);
		
		sb.setCharAt(5, '*');
		System.out.println(sb);
		
		String str= sb.substring(6);
		System.out.println(str);
		
		str.substring(6,9);
		System.out.println(str);
		
	}
}
